package com.zx.crowdfunding.entity;

import java.io.Serializable;
import java.util.LinkedHashSet;

/**
 * <p>管理员实体类</p>
 * 
 * <p>必须要实现序列化接口，因为SpringSession当把对象存入数据库时需要用到序列化，
 * 在用户登录成功后会把原始的Admin对象放入我们自定义的SecurityAdmin对象中，
 * 然后SpringSecurity会将SecurityAdmin对象存入Session中。
 * 所以管理员实体类需要实现序列化接口，不然会抛出异常。</p>
 * 
 * @author 郑雪
 * @date 2021-12-17
 */
public class Admin implements Serializable{
	
	private static final long serialVersionUID = 1L;

	private Integer id;

    private String loginAcct;

    private String userPswd;

    private String userName;

    private String email;

    private String createTime;
    
    private LinkedHashSet<Menu> menu;
    
    public Admin() {}

	public Admin(Integer id, String loginAcct, String userPswd,
			String userName, String email, String createTime) {
		super();
		this.id = id;
		this.loginAcct = loginAcct;
		this.userPswd = userPswd;
		this.userName = userName;
		this.email = email;
		this.createTime = createTime;
	}

	@Override
	public String toString() {
		return "Admin [id=" + id + ", loginAcct=" + loginAcct + ", userPswd="
				+ userPswd + ", userName=" + userName + ", email=" + email
				+ ", createTime=" + createTime + "]";
	}

	public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getLoginAcct() {
        return loginAcct;
    }

    public void setLoginAcct(String loginAcct) {
        this.loginAcct = loginAcct == null ? null : loginAcct.trim();
    }

    public String getUserPswd() {
        return userPswd;
    }

    public void setUserPswd(String userPswd) {
        this.userPswd = userPswd == null ? null : userPswd.trim();
    }

    public String getUserName() {
        return userName;
    }

    public void setUserName(String userName) {
        this.userName = userName == null ? null : userName.trim();
    }

    public String getEmail() {
        return email;
    }

    public void setEmail(String email) {
        this.email = email == null ? null : email.trim();
    }

    public String getCreateTime() {
        return createTime;
    }

    public void setCreateTime(String createTime) {
        this.createTime = createTime == null ? null : createTime.trim();
    }

	public LinkedHashSet<Menu> getMenu() {
		return menu;
	}

	public void setMenu(LinkedHashSet<Menu> menu) {
		this.menu = menu;
	}
}